#pragma once
#include<SFML\Graphics.hpp>
#include "BulletFactory.h"
#include <SFML/Network.hpp>

namespace cat
{
	class Tank
	{
	private:
		struct TankPosition { double x,y; } _position;
		struct TankVelocity { double x,y; } _velocity;
		double _turretDirection,
		_cannonY, _cannonTargetY;
		int _burstFrameTimer;
		struct{ double velocity, angle; } _input;
		struct{
			sf::CircleShape turret;
			sf::RectangleShape gunLeft, gunRight;
		} _visual;

		void FireLeft();
		void FireRight();
	public:
		Tank();

		void think();
		void draw();

		void move(double angle, double velocity);
		void setVelocity(double velocity);
		void update(double x, double y, double vx, double vy);
		void turretTarget(double x, double y);
		void fire();

		TankPosition getPosition(void) { return _position; }
		TankVelocity getVelocity(void) { return _velocity; }

		~Tank(void);
	};
}

